package com.dhn.controller;

import com.dhn.entity.Department;
import com.dhn.entity.Sys_roles;
import com.dhn.service.Sys_rolesService;
import com.dhn.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class Sys_rolesController {
    @Autowired
    private Sys_rolesService sys_rolesService;
    @RequestMapping("getSys_roles")
    @ResponseBody
    public Object getSys_roles(Sys_roles sys_roles){
        int total = sys_rolesService.getTotal(sys_roles);
        sys_roles.setPage((sys_roles.getPage()-1)*sys_roles.getLimit());
        List<Sys_roles> list = sys_rolesService.getSys_roles(sys_roles);
        return Result.toClient("0","",total,list);
    }
}
